package com.yishan.gulimall.springsecurity.config;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class R<T> {
    private int code;
    private String msg;
    private T data;
    public static <T> R<T> success(T data) {
        R<T> r = new R<T>();
        r.setCode(200);
        r.setMsg("success");
        r.setData(data);
        return r;
    }
    public static <T> R<T> error( String msg) {
        R<T> r = new R<T>();
        r.setCode(500);
        r.setMsg(msg);
        return r;
    }
}
